package com.jzfai.controller;

import com.jzfai.entity.Admin;
import com.jzfai.service.LoginService;
import com.jzfai.utils.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * @Title: LoginController
 * @Description:
 * @Auther:Administrator
 * @Version: 1.0
 * @create 2019/8/13 11:49
 */
@RestController
@RequestMapping("login")
public class LoginController {
    @Autowired
    LoginService loginService;
    @PostMapping("doLogin")
    public JsonData doLogin(@RequestBody Admin admin){
        return loginService.doLogin(admin);
    }
    @PostMapping("loginOut")
    public JsonData loginOut(){
        return loginService.loginOut();
    }
    @PostMapping("doAddUser")
    public JsonData doAddUser(@RequestBody Admin admin){
        return loginService.doAddUser(admin);
    }

    @PostMapping("editUser")
    public JsonData editUser(@RequestBody Admin admin){
        return loginService.editUser(admin);
    }
    @GetMapping("getListUser")
    public JsonData getListUser(){
        return loginService.getListUser();
    }
    @PostMapping("deleteUser")
    public JsonData deleteUser(@RequestParam Integer id){
        return loginService.deleteUser(id);
    }
}
